package org.ifilm.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.CollectionOfElements;

/**
 * 
 * Project Model
 * @author Mustafa Genç
 *
 */
@Entity(name = "project")
public class Project {
	@Id
	@GeneratedValue
	long id;
	
	private String projectName;
	
	private String thumbnailUrl;
	
	@CollectionOfElements
	private List<String> photoPaths = new ArrayList<String>();
	
	private String description;
	
	private String subject;
	
	private String language;
	
	private String country;
	
	private String city;
	
	private float averageRate = (float) 0.0;
	
	private long totalRate = 0;
	
	private String startDate;
	
	private String releaseDate;
	
	private Date creationTime;
	
	private Date updateTime;
	
	@OneToOne
	private User creator;
	
	@OneToMany
	private List<UserJobPosting> jobPostings = new ArrayList<UserJobPosting>();
	
	@OneToMany
	private List<EquipmentPosting> equipmentPostings = new ArrayList<EquipmentPosting>();

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getThumbnailUrl() {
		return thumbnailUrl;
	}

	public void setThumbnailUrl(String thumbnailUrl) {
		this.thumbnailUrl = thumbnailUrl;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getReleaseDate() {
		return releaseDate;
	}

	public void setReleaseDate(String releaseDate) {
		this.releaseDate = releaseDate;
	}

	public float getAverageRate() {
		return averageRate;
	}

	public void setAverageRate(float averageRate) {
		this.averageRate = averageRate;
	}

	public long getTotalRate() {
		return totalRate;
	}

	public void setTotalRate(long totalRate) {
		this.totalRate = totalRate;
	}

	public Date getCreationTime() {
		return creationTime;
	}

	public void setCreationTime(Date creationTime) {
		this.creationTime = creationTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public User getCreator() {
		return creator;
	}

	public void setCreator(User creator) {
		this.creator = creator;
	}
	
	@JsonIgnore
	public List<UserJobPosting> getJobPostings() {
		return jobPostings;
	}

	public void setJobPostings(List<UserJobPosting> jobPostings) {
		this.jobPostings = jobPostings;
	}
	
	@JsonIgnore
	public List<EquipmentPosting> getEquipmentPostings() {
		return equipmentPostings;
	}
	
	public void setEquipmentPostings(List<EquipmentPosting> equipmentPostings) {
		this.equipmentPostings = equipmentPostings;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}
	
	public List<String> getPhotoPaths() {
		return photoPaths;
	}

	public void setPhotoPaths(List<String> photoPaths) {
		this.photoPaths = photoPaths;
	}
}